package com.qf.day08;

import com.qf.day06.Dog;

public class MyUtils {


    public static void trainFire(Fireable fireable){
        fireable.fire();
    }

    /**
     * 飞行员训练
     * @param flyable 需要传入的对象是实现了Flyable接口的对象
     */
    public static void trainFlyer(Flyable flyable){

        for (int i = 0; i < 5; i++) {
            flyable.fly();
        }

    }


    /**
     * 静态方法的参数设置为接口类型
     * @param myInterface
     */
    public static void method01(MyInterface myInterface){
        myInterface.test1(10);
        myInterface.test2();
    }

    public static void main(String[] args) {

        Bird bird = new Bird();
        trainFlyer(bird);
        trainFire(bird);

//        Dog dog = new Dog();
//        trainFlyer(dog);

//        MyImpl my = new MyImpl();
//        MyUtils.method01(my);
//
//        MyImpl2 myImpl2 = new MyImpl2();
//        MyUtils.method01(myImpl2);
    }
}
